﻿<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" CodeBehind="BulkEditSecurity.ascx.cs" Inherits="SiteSecurityManagement.BulkEditSecurity, SiteSecurityManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a89ed8157749efce" MasterPageFile="~/_layouts/application.master"      %> 
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="secTree" TagName="SecurityTree" Src="~/_controltemplates/ssmu/SecurityTree.ascx"%>
<%@ Assembly Name="SiteSecurityManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a89ed8157749efce"%>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register Tagprefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Import Namespace="Microsoft.SharePoint" %>
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<SCRIPT language="JavaScript">

</SCRIPT>
</asp:Content>
<asp:Content contentplaceholderid="PlaceHolderPageTitle" runat="server">
	<SharePoint:EncodedLiteral runat="server" text="<%$Resources:ssmu.Resources,bulkEditSecurity_pagetitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:content contentplaceholderid="PlaceHolderPageTitleInTitleArea" runat="server">
	<SharePoint:EncodedLiteral runat="server" text="<%$Resources:ssmu.Resources,bulkEditSecurity_pagetitle%>" EncodeMethod='HtmlEncode'/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
	<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,aclinv_pagedescription%>" EncodeMethod='HtmlEncode'/>
	<br />
	<br />
	<span class="ms-alerttext"><SharePoint:EncodedLiteral runat="server" text="<%$Resources:ssmu.Resources,bulkEditSecurity_pageDescriptionNotice %>" EncodeMethod="HtmlEncode" /></span>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server">
<div class="ms-quicklaunchouter">
	<div class="ms-quickLaunch" style="width:100%">
	    <table class="ms-navSubMenu1" cellpadding="0" cellspacing="0" border="0">
			<tr>
			  <td>
				<table class="ms-navheader" width="100%" cellpadding="0" cellspacing="0" border="0">
				  <tr>
					<td nowrap id="Td1">
					  <SharePoint:SPLinkButton runat="server" NavigateUrl="ssmu_bulkEditSecurity.aspx" id="secTreeLinkButton" Text="<%$Resources:ssmu.Resources,treeview_header%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
					</td>
				  </tr>
				</table>
			  </td>
			</tr>
			<tr>
			    <td>
			        <a href="ssmu_editSecurity.aspx" title='<asp:Literal ID="Literal1" runat="server" Text="<%$Resources:ssmu.Resources,editSecurity_pagetitle%>" />'>
			            <img border="0" src="/_layouts/images/ssmu/editOne.gif" /></a>
			        <a href="ssmu_bulkEditSecurity.aspx" title='<asp:Literal ID="Literal2" runat="server" Text="<%$Resources:ssmu.Resources,bulkEditSecurity_pagetitle%>" />'>
			            <img border="0" src="/_layouts/images/ssmu/editMany.gif" /></a>
			        <a href="ssmu_resetInheritance.aspx" title='<asp:Literal ID="Literal3" runat="server" Text="<%$Resources:ssmu.Resources,resetInheritance_pagetitle%>" />'>
			            <img border="0" src="/_layouts/images/ssmu/many.gif" /></a>
			    </td>
			</tr>
		  </table>
	    <div class="ms-treeviewouter">
            <secTree:SecurityTree ShowCheckBoxes=true EnableNavigationUrl="true" runat="server" id="secTree"></secTree:SecurityTree>
        </div>
    </div>
</div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
            <TABLE border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet">
        <tbody>
        <tr>
            <td colspan="2">
	                <wssuc:InputFormSection Title="<%$Resources:wss,aclinv_Step1Title%>"
		                Description="<%$Resources:wss,aclinv_DescGrantIndiv%>"
		                runat="server">
		                <Template_Description>
			                <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" text="<%$Resources:wss,aclinv_DescGrantIndiv%>" EncodeMethod='HtmlEncode'/>
			                <br>
			                <br>
		                </Template_Description>
		                <Template_InputFormControls>
			                <wssuc:InputFormControl LabelText="<%$Resources:wss,aclinv_UserGroupsLabel%>" runat="server">
				                <Template_Control>
					                <wssawc:PeopleEditor
								                AllowEmpty=false
								                ValidatorEnabled="true"
								                id="userPicker"
								                runat="server"
								                ShowCreateButtonInActiveDirectoryAccountCreationMode=true
								                SelectionSet="User,SecGroup,SPGroup"
								                />
				                </Template_Control>
			                </wssuc:InputFormControl>
		                </Template_InputFormControls>
	                </wssuc:InputFormSection>
	                <wssuc:InputFormSection
		                Title="<%$Resources:wss,aclinv_Step2Title1%>"
		                Description="<%$Resources:ssmu.Resources,bulkEditSecurity_step2Description%>"
		                runat="server">
		                <Template_InputFormControls>
			                <wssuc:InputFormControl runat="server" LabelText="<%$Resources:wss,aclinv_PermsLabel%>">
				                <Template_Control>
					                <table class="ms-authoringcontrols" border="0" cellpadding="0" cellspacing="0" width="100%">
							                <asp:PlaceHolder id="PanelCannotAddUserToRoleInheritedPerm" runat="server" Visible="false">
								                <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" text="<%$Resources:wss,aclinv_inheritperm_msg%>" EncodeMethod='HtmlEncode'/>
							                </asp:PlaceHolder>
							                <asp:PlaceHolder id="PanelCannotAddUserToRoleNoPerm" runat="server" Visible="false">
								                <SharePoint:EncodedLiteral ID="EncodedLiteral3" runat="server" text="<%$Resources:wss,aclinv_adduserdirectly_noperm%>" EncodeMethod='HtmlEncode'/>
							                </asp:PlaceHolder>
							                <wssawc:InputFormCheckBoxList
										                id="cblRoles"
										                runat="server"
										                class="ms-authoringcontrols"/>
							                <wssawc:InputFormCheckBoxListValidator
										                id="ValCblRoles"
										                ControlToValidate="cblRoles"
										                DisplayMode="Static"
										                ErrorMessage="<%$Resources:wss,aclinv_NoPermission_ERR%>"
										                runat="server" />
							                <asp:PlaceHolder id="PanelError" visible="true" runat="server">
								                <br><br>
								                <span class="ms-alerttext"><SharePoint:EncodedLiteral ID="generalError" runat="server" text=" " EncodeMethod='HtmlEncode'/></span>
							                </asp:PlaceHolder>
					                </table>
				                </Template_Control>
			                </wssuc:InputFormControl>
		                </Template_InputFormControls>
	                </wssuc:InputFormSection>
	                </td>
	            </tr>
		        <tr>
			        <td>
			            <table cellpadding="0" cellspacing="0" width="100%" class="ms-propertysheet">
					        <colgroup>
						        <col width="80%">
						        <col width="20%">
					        </colgroup>
					        <tr>
						        <td>
							        &nbsp;</td>
						        <td nowrap>
				                    <asp:Button runat="server" ID="btnAdd" class="ms-ButtonHeightWidth" OnClick="btnAdd_Click" Text="<%$Resources:ssmu.Resources,bulkEditSecurity_listButton %>" />
				                </td>
	                        </tr>
	                     </table>
			        </td>
		        </tr>
		        <tr>
			        <td height="10px" class="ms-descriptiontext" colspan="2"><IMG SRC="/_layouts/images/blank.gif" width=1 height=10 alt=""></td>
		        </tr>
		        <tr>
	                <td colspan="2">
	                    <table class="ms-propertysheet" border=0 width="80%">
	                    <tbody>
	                    <tr>
	                    <td>
	                    <SharePoint:SPGridView runat="server" ID="spgvwUsers" AutoGenerateColumns="false" 
	                         OnRowDeleting="spgvwUsers_RowDeleting" EmptyDataText="<%$Resources:ssmu.Resources,bulkEditSecurity_emptyList %>">
	                    <Columns>
	                        <asp:CommandField HeaderStyle-CssClass="ms-vh2" ControlStyle-CssClass="ms-cbp" 
	                            showdeletebutton="true" ButtonType="Link" DeleteText="<%$Resources:ssmu.Resources,bulkEditSecurity_removeListItem%>"/>
	                        <asp:TemplateField HeaderStyle-CssClass="ms-vh2-nofilter" HeaderText="<%$Resources:wss,user_idHeadingUser%>" HeaderStyle-ForeColor="#808080" HeaderStyle-Width="20%">
		                        <ItemTemplate>
			                        <table cellpadding=0 cellspacing=0>
				                    <tr>
					                    <td width="3px">
						                    <IMG SRC="/_layouts/images/blank.gif" width=3 height=1 alt="">
					                    </td>
					                    <td style="padding-top:2px;" class="ms-vb">
                        			        <%# SPHttpUtility.HtmlEncode(DataBinder.Eval(Container.DataItem, "colUsersGroups").ToString()) %>
					                    </td>       
				                    </tr>
			                        </table>
		                        </ItemTemplate>
	                        </asp:TemplateField>
	                        <asp:TemplateField HeaderStyle-CssClass="ms-vh2-nofilter" HeaderText="<%$Resources:wss,user_idHeadingType%>" HeaderStyle-ForeColor="#808080" HeaderStyle-Width="10%">
		                        <ItemTemplate>
			                        <INPUT type="hidden" name=PrincipalType 
			                            value='<%# SPHttpUtility.UrlKeyValueEncode((string)DataBinder.Eval(Container.DataItem, "colType")) %>' >
			                        <%# SPHttpUtility.HtmlEncode(DataBinder.Eval(Container.DataItem, "colType").ToString()) %>
			                        <IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt="">
		                        </ItemTemplate>
	                        </asp:TemplateField>
	                        <asp:TemplateField HeaderStyle-CssClass="ms-vh2-nofilter" HeaderText="<%$Resources:wss,user_idHeadingUserName%>" HeaderStyle-ForeColor="#808080" HeaderStyle-Width="20%">
		                        <ItemTemplate>
			                        <%# SPHttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "colUserName").ToString()) %>
		                        </ItemTemplate>
	                        </asp:TemplateField>
	                        <asp:TemplateField HeaderStyle-CssClass="ms-vh2-nofilter" HeaderText="<%$Resources:wss,user_idHeadingRole%>" HeaderStyle-ForeColor="#808080" HeaderStyle-Width="50%">
		                        <ItemTemplate>
			                        <%# SPHttpUtility.HtmlEncode((string)DataBinder.Eval(Container.DataItem, "colPermissions").ToString()) %>
		                        </ItemTemplate>
	                        </asp:TemplateField>
	                    </Columns>
	                    </SharePoint:SPGridView>
	                    </td>
	                    </tr>
	                    </tbody>
	                    </table>
	                </td>
	            </tr>
	            <tr>
	            <tr>
			        <td height="10px" class="ms-descriptiontext" colspan="2"><IMG SRC="/_layouts/images/blank.gif" width=1 height=10 alt=""></td>
		        </tr>
		        <tr>
			        <td>
				        <table cellpadding="0" cellspacing="0" width="100%" class="ms-propertysheet">
					        <colgroup>
						        <col width="80%">
						        <col width="20%">
					        </colgroup>
					        <tr>
						        <td>
							        &nbsp;</td>
						        <td nowrap>
            	                    <asp:Button runat="server" ID="btnSubmit" enabled="false" class="ms-ButtonHeightWidth" OnClick="btnSubmit_Click" Text="<%$Resources:ssmu.Resources,bulkEditSecurity_submitButton %>" />
	                            </td>
	                        </tr>
	                     </table>
	                 </td>
	            </tr>
	            </tbody>
        </TABLE>
</asp:Content>
